<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>mini vue</title>
  </head>
  <body>
    <div id="app">
      <h1>
        <span>mustache：</span>
        <span>{{ msg }}</span>
      </h1>

      <h1>
        <span>v-text：</span>
        <span v-text="msg"></span>
      </h1>

      <h1>
        <span>v-model：</span>
        <input type="text" v-model="msg" />
      </h1>

      <h1>
        <span>v-html：</span>
        <span v-html="dom"></span>
      </h1>

      <h1>
        <span>v-on</span>
        <button v-on:click="handleClick">v-on:</button>
        <button @click="handleClick">@</button>
      </h1>
    </div>
  </body>
  <script src="./js/dep.js"></script>
  <script src="./js/watcher.js"></script>
  <script src="./js/compiler.js"></script>
  <script src="./js/observer.js"></script>
  <script src="./js/vue.js"></script>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        msg: 'Hello Vue',
        dom: '<s style="color: red">Hello Vue</s>',
      },
      methods: {
        handleClick() {
          alert(this.msg)
          // alert('msg');
        },
      },
    })
  </script>
</html>
